<template>
	<div class="bigDiv">
		<el-form :inline="true" label-width="88px">
			<div class="topNav">
				<el-button type="text" icon="el-icon-search" @click="handelSearch">搜索</el-button>
			</div>
			<el-form-item label="创建查询" prop="time">
				<el-date-picker  v-model="queryParams.operTime" clearable size="small" type="daterange" range-separator="至" start-placeholder="开始日期"
					end-placeholder="结束日期" value-format="yyyy-MM-dd hh:mm:ss">
				</el-date-picker>
			</el-form-item>
			<el-form-item label="方法名称" >
				<el-input v-model="queryParams.title" placeholder="方法名称" clearable size="small"
					 />
			</el-form-item>
			<el-form-item label="请求参数">
				<el-input v-model="queryParams.operParam" placeholder="请求参数" clearable size="small" 
					 />
			</el-form-item>
			<el-form-item label="返回参数">
				<el-input  v-model="queryParams.jsonResult" placeholder="返回参数" clearable size="small" 
					 />
			</el-form-item>
		</el-form>
		
		<el-table :data="list" height="calc(100vh - 350px)">
			<el-table-column label="方法名称" align="center" prop="title" />
			<el-table-column label="请求参数" align="center" prop="operParam" />
			<el-table-column label="返回参数" align="center" prop="jsonResult" />
			<el-table-column label="创建时间" align="center" prop="operTime" />
		</el-table>
		<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
			:limit.sync="queryParams.pageSize" @pagination="handelSearch" />
	</div>
</template>

<script>
 
	import {pscsLogMapper} from '@/api/admin.api';
	export default{
		data() {
			return {
				timeModel:['',''],
				queryParams: {
					pageNum: 1,
					pageSize: 10,
					title:undefined,
					operParam: undefined,
					jsonResult: undefined,
					operTime:['','']
				},
				total: 0, 
				list: []
			}
		},
		mounted() {
			// this.getList();
		},
		methods: {
			handelSearch(){
				let queryParams = {
					pageNum: this.queryParams.pageNum,
					pageSize: this.queryParams.pageSize,
					title:this.queryParams.title,
					operParam: this.queryParams.operParam,
					jsonResult: this.queryParams.jsonResult,
					beginTime:this.queryParams.operTime[0],
					endTime:this.queryParams.operTime[1]
				}
				pscsLogMapper(queryParams).then(res => {
					this.total = res.total
					this.list = res.rows
				})
			}
			
		}
	}
</script>

<style>
</style>